@import "../theme/theme.wxss";

.my-tabbar {
  position: relative;
  // background-color: #fff;
  background-color: var(--tabbarBackgroundColor);
  height: calc(env(safe-area-inset-bottom) + 56px);
  // border-top: 1px solid #f1f1f1;
  border-top: var(--tabbarBorder);

  .tab-list {
    display: flex;
    align-items: center;
    width: 100vw;
    height: 56px;
    // background-color: #fff;
    background-color: var(--tabbarBackgroundColor);
  }

  .tab-bar-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;

    .img-container {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      // transition: all 0.5s;
    }

    .img {
      width: 100%;
      height: 100%;
    }

    .text {
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      // color: #050505;
      color: var(--tabbarFontColor);
    }

    .animate__heartBeat {
      -webkit-animation-name: heartBeat;
      animation-name: heartBeat;
      -webkit-animation-delay: 3s;
      animation-delay: 3s;
      -webkit-animation-duration: 1.5s;
      animation-duration: 1.5s;
      -webkit-animation-timing-function: ease-in-out;
      animation-timing-function: ease-in-out;
      -webkit-animation-iteration-count: infinite;
      animation-iteration-count: infinite;
    }

    .animate__rotateIn {
      -webkit-animation-name: rotateIn;
      animation-name: rotateIn;
      -webkit-animation-delay: 3s;
      animation-delay: 3s;
      -webkit-animation-duration: 1.5s;
      animation-duration: 1.5s;
      -webkit-transform-origin: center;
      transform-origin: center;
      -webkit-animation-iteration-count: infinite;
      animation-iteration-count: infinite;
    }


    .animate__shakeX {
      -webkit-animation-name: shakeX;
      animation-name: shakeX;
      -webkit-animation-delay: 3s;
      animation-delay: 3s;
      -webkit-animation-duration: 2s;
      animation-duration: 2s;
      -webkit-animation-iteration-count: infinite;
      animation-iteration-count: infinite;
    }
  }

  .tab-bar-item.tab_active {
    .img-container {
      width: 56px;
      height: 56px;
      // background-color: rgba(227, 62, 51, .8);
      background-color: #f9906f;
      // transform: translateY(-60rpx);
      border-radius: 56px;
      box-sizing: border-box;
      // border: 10rpx solid #fff;
      border: var(--tabBorderStyle);

      // &::before {
      //   content: '';
      //   display: block;
      //   position: absolute;
      //   left: -28rpx;
      //   top: 52rpx;
      //   width: 30rpx;
      //   height: 30rpx;
      //   background-color: #97a791;
      //   border-radius: 0 30rpx 0 0;
      //   box-shadow: 0px -10rpx 0 0 #fff;
      // }

      // &::after {
      //   content: '';
      //   display: block;
      //   position: absolute;
      //   right: -28rpx;
      //   top: 52rpx;
      //   width: 30rpx;
      //   height: 30rpx;
      //   background-color: #97a791;
      //   border-radius: 30rpx 0 0 0;
      //   box-shadow: 0px -10rpx 0 0 #fff;
      // }

      .img {
        width: 32px;
        height: 32px;
      }
    }

    .text {
      display: none;
    }
  }
}

@keyframes heartBeat {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }

  14% {
    -webkit-transform: scale(1.3);
    transform: scale(1.3);
  }

  28% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }

  42% {
    -webkit-transform: scale(1.3);
    transform: scale(1.3);
  }

  70% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}

@keyframes rotateIn {
  from {
    -webkit-transform: rotate3d(0, 0, 1, -200deg);
    transform: rotate3d(0, 0, 1, -200deg);
    opacity: 0;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}

@keyframes shakeX {

  from,
  to {
    -webkit-transform: translate3d(0, 0, 0) rotateZ(0deg);
    transform: translate3d(0, 0, 0) rotateZ(0deg);
  }

  10%,
  20%,
  30%,
  40% {
    -webkit-transform: translate3d(0, 0, 0) rotateZ(0deg);
    transform: translate3d(0, 0, 0) rotateZ(0deg);
  }

  // 10%,
  // 30%,
  50%,
  70%,
  90% {
    -webkit-transform: translate3d(-10rpx, 0, 0) rotateZ(10deg);
    transform: translate3d(-10rpx, 0, 0) rotateZ(10deg);
  }

  // 20%,
  // 40%,
  60%,
  80% {
    -webkit-transform: translate3d(10rpx, 0, 0) rotateZ(-10deg);
    transform: translate3d(10rpx, 0, 0) rotateZ(-10deg);
  }
}